package com.ruoyi.model.service.impl;

import java.util.List;

import cn.hutool.core.util.IdUtil;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.model.mapper.ModelAlgorithmParamMapper;
import com.ruoyi.model.domain.ModelAlgorithmParam;
import com.ruoyi.model.service.IModelAlgorithmParamService;

/**
 * 算法参数Service业务层处理
 *
 * @author rww
 * @date 2024-11-25
 */
@Service
public class ModelAlgorithmParamServiceImpl implements IModelAlgorithmParamService
{
    @Autowired
    private ModelAlgorithmParamMapper modelAlgorithmParamMapper;

    /**
     * 查询算法参数
     *
     * @param id 算法参数主键
     * @return 算法参数
     */
    @Override
    public ModelAlgorithmParam selectModelAlgorithmParamById(Long id)
    {
        return modelAlgorithmParamMapper.selectModelAlgorithmParamById(id);
    }

    /**
     * 查询算法参数列表
     *
     * @param modelAlgorithmParam 算法参数
     * @return 算法参数
     */
    @Override
    public List<ModelAlgorithmParam> selectModelAlgorithmParamList(ModelAlgorithmParam modelAlgorithmParam)
    {
        return modelAlgorithmParamMapper.selectModelAlgorithmParamList(modelAlgorithmParam);
    }

    /**
     * 新增算法参数
     *
     * @param modelAlgorithmParam 算法参数
     * @return 结果
     */
    @Override
    public int insertModelAlgorithmParam(ModelAlgorithmParam modelAlgorithmParam)
    {
        modelAlgorithmParam.setId(IdUtil.getSnowflakeNextId());
        modelAlgorithmParam.setCreateTime(DateUtils.getNowDate());
        return modelAlgorithmParamMapper.insertModelAlgorithmParam(modelAlgorithmParam);
    }

    /**
     * 修改算法参数
     *
     * @param modelAlgorithmParam 算法参数
     * @return 结果
     */
    @Override
    public int updateModelAlgorithmParam(ModelAlgorithmParam modelAlgorithmParam)
    {
        modelAlgorithmParam.setUpdateTime(DateUtils.getNowDate());
        return modelAlgorithmParamMapper.updateModelAlgorithmParam(modelAlgorithmParam);
    }

    /**
     * 批量删除算法参数
     *
     * @param ids 需要删除的算法参数主键
     * @return 结果
     */
    @Override
    public int deleteModelAlgorithmParamByIds(Long[] ids)
    {
        return modelAlgorithmParamMapper.deleteModelAlgorithmParamByIds(ids);
    }

    /**
     * 删除算法参数信息
     *
     * @param id 算法参数主键
     * @return 结果
     */
    @Override
    public int deleteModelAlgorithmParamById(Long id)
    {
        return modelAlgorithmParamMapper.deleteModelAlgorithmParamById(id);
    }
}
